﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Mvc.Html;

using ERPStore.Localization.Html;

namespace ERPStore.Localization.Models
{
	public class LocalizableLabel 
	{
		private Dictionary<string, string> m_Translations;
		private HtmlHelper m_Helper;

		public LocalizableLabel()
		{
			m_Translations = new Dictionary<string, string>();
		}

		public LocalizableLabel AddTranslation(string language, string content)
		{
			m_Translations.Add(language, content);
			return this;
		}

		public MvcHtmlString Translate()
		{

			var currentLanguage = m_Helper.GetCurrentLanguage();
			var content = m_Translations[currentLanguage];
			return m_Helper.Label(content);
		}
	}
}
